#pragma once 
#include<iostream>
#include <stdlib.h>
#include <unistd.h>
#define TaskNum 3
typedef void (*task_t)();
void Print()
{
    std::cout << "I am print task" << std::endl;
}
void DownLoad()
{
    std::cout << "I am a download task" << std::endl;
}
void Flush()
{
    std::cout << "I am a flush task" << std::endl;
}
task_t tasks[TaskNum];
void InitTask()
{
    srand(time(nullptr)^getpid()^17777);
    tasks[0] = Print;
    tasks[1] = DownLoad;
    tasks[2] = Flush;
}
void ExcuteTask(int number)
{
    if(number<0||number>2)return ;
    tasks[number]();
}
int SelectTask()
{
    return rand()%TaskNum;
}
